import request from '@/utils/request'

// 获取组织架构
export const getDepartmentsAPI = () => request({
    url: '/company/department',
    method: 'GET'
})

// 删除部门接口
export const deletePartments = (id) => request({
    url: `/company/department/${id}`,
    method: 'DELETE'
})

// 新增部门接口
export const addDepartments = (data) => request({
    url: '/company/department',
    method: 'POST',
    data
})

// 根据id查询部门详情
export const getDepartmentsIdAPI = (id) => request({
    url: `/company/department/${id}`,
    method: 'GET'
})

// 编辑部门
export const updateDepartments = (data) => request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
})